<?php
 
defined("_VALID_ACCESS") || die('Direct access forbidden');
 
class SCTV_DeploymentCommon extends ModuleCommon {
 
    public static function menu() {
    	$menus[__('SCTV')] = array('__submenu__' => 1);
		
		if(Base_AclCommon::check_permission('Delivery requirement: Today'))
			$menus[__('SCTV')][__('Delivery requirement'). ': ' . __('Today')] = array('__function__'=>'today');
		
		if(Base_AclCommon::check_permission('Delivery requirement: Tomorrow'))
			$menus[__('SCTV')][__('Delivery requirement'). ': ' . __('Tomorrow')] = array('__function__'=>'tomorrow');  
		 		
        return $menus;
    }
	public static function deployment_exists($requirement, $date, $employee){
		$ret = DB::GetOne('SELECT id FROM sctv_deployment_data_1 WHERE sctv_deployment_data_1.active = 1 and f_requirement = %d and f_date = %T and f_technical = %d', array($requirement, $date, $employee));
		$ret = ($ret!==false && $ret!==null);
		return $ret;
	}
	public static function deployment_not_exists($requirement, $date, $employee){
		return !SCTV_DeploymentCommon::deployment_exists($requirement, $date, $employee);
	}
}
 
?>